package cn.tang.tframe.storage;

import cn.tang.tframe.storage.ks3.KsUploader;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;

/**
 * Created by tanghc on 17/2/16.
 */
public class KsTestMain {
	public static void main(String[] args) throws FileNotFoundException {

		KsUploader instance = KsUploader.getInstance();
		File file =new File("/tmp/test.png");
//		System.out.println(instance.uploadFile(file));
		System.out.println(instance.uploadStream("test.png",new FileInputStream(file),file.length()));
//		System.out.println(instance.removeByUrl("http://qtuc.ks3-cn-beijing.ksyun.com/basedata/2017021618/58a58041bd746a75089f650a.png"));
//		System.out.println(instance.objectExists());
		// instance.upload(new File("/tmp/test.png"));
		// instance.upload(new File("/tmp/test.log"));
		// instance.createBucketSimple();
		// List<Bucket> buckets = instance.listBuckets();
		// if(null != buckets){
		// for(Bucket bucket: buckets){
		// System.out.println("bucks:"+bucket.getName());
		// }
		// }

	}
}
